/**
 * 数据填报主页js
 */
/**
 * 主页图片切换
 */
$('#indexMainTabs').tabs({
	onSelect:function(){
		inithomePageData();
	}
})
inithomePageData();
function inithomePageData(){
	$.ajax({
	     url:'d/details',
	     type: 'post',
	     data:{
	    	 org_guid: orange.getOrganizationData().id
		 },
	     success: function(data) {
	    	 $('#homeDetailForm').form('load', data);
	    	 //时间单独赋值
	    	 $('#foundedTimedata').val(dateFormat.dateFormat(new Date(data.foundedTime)));
	    	 $('#sliderw').empty()
	    	 var photoPath = data.photoPath;
	    	 if(null != photoPath && photoPath != ''){
	    		 var photoPathArr = photoPath.split(',');
//	    		 $('#sliderw').append('<img src="'+ photoPathArr[0] +'" class="home-image" />')
	    		 if(photoPathArr.length > 0){
	    			 for(var i=1; i < photoPathArr.length;i++){
	    				 $('#sliderw').append('<img src="'+ photoPathArr[i] +'" class="home-image" />')
	        		 }
	    		 }
	    	 }else{
	    		 $('#sliderw').append('<img src="resources/images/nophotos.jpg" class="home-image" />')
	    	 }
	    	 new IdealImageSlider.Slider('#sliderw');
	     }
	});
}


